/*
 * Util.h
 *
 *  Created on: Jun 14, 2011
 *      Author: hongyang
 */

#ifndef UTIL_H_
#define UTIL_H_

#include "../smartgame/SgPointSet.h"
#include "../smartgame/SgArrayList.h"
#include "../smartgame/SgBWArray.h"
#include "../smartgame/SgVector.h"

namespace Util {
extern void copy(SgPointSet& set1, const SgPointSet& s2);

extern void copy(SgBWArray<int>& a1, const SgBWArray<int> a2);

template<typename T, int size>
extern void copy(SgArrayList<T, size>& list1, const SgArrayList<T, size>& list2) {
	for (int i = 0; i < list2.Length(); i++) {
		list1.Include(list2[i]);
	}
}

template<typename T, int size>
extern void copy(SgArrayList<T, size>& list1, SgArrayList<T, size>& list2) {
	for (int i = 0; i < list2.Length(); i++) {
		list1.Include(list2[i]);
	}
}

template<typename T, int size>
extern void copy(SgArray<T, size>& list1, const SgArray<T, size>& list2) {
	for (int i = 0; i < size; i++) {
		list1[i] = list2[i];
	}
}

}
#endif /* UTIL_H_ */
